package com.yzx.lifeassistants.listener;

import java.util.List;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;

import com.yzx.lifeassistants.activity.ActivityActivity;
import com.yzx.lifeassistants.activity.RunningActivity;
import com.yzx.lifeassistants.activity.JobActivity;
import com.yzx.lifeassistants.activity.LectureActivity;
import com.yzx.lifeassistants.activity.LibraryActivity;
import com.yzx.lifeassistants.activity.LivingActivity;
import com.yzx.lifeassistants.activity.OfficeActivity;
import com.yzx.lifeassistants.activity.PartTimeActivity;
import com.yzx.lifeassistants.activity.FoodActivity;
import com.yzx.lifeassistants.bean.ClassifyItem;

/**
 * @Description: 校园资讯分类监听器
 * @author: yzx
 * @time: 2015-11-16 上午8:48:59
 */
public class CampusNewsGridListener implements OnItemClickListener {
	private Context context;
	/**
	 * @Description: 类别列表
	 */
	private List<ClassifyItem> classifyList;

	public CampusNewsGridListener(Context context,
			List<ClassifyItem> classifyList) {
		this.context = context;
		this.classifyList = classifyList;
	}

	@Override
	public void onItemClick(AdapterView<?> arg0, View view, int position,
			long arg3) {
		Intent intent = new Intent();
		String bigClass = classifyList.get(position).getBigClass();
		if ("0".equals(bigClass)) {
			intent.setClass(context, OfficeActivity.class);
		} else if ("1".equals(bigClass)) {
			intent.setClass(context, LectureActivity.class);
		} else if ("2".equals(bigClass)) {
			intent.setClass(context, JobActivity.class);
		} else if ("3".equals(bigClass)) {
			intent.setClass(context, RunningActivity.class);
		} else if ("4".equals(bigClass)) {
			intent.setClass(context, FoodActivity.class);
		} else if ("5".equals(bigClass)) {
			intent.setClass(context, ActivityActivity.class);
		} else if ("6".equals(bigClass)) {
			intent.setClass(context, LibraryActivity.class);
		} else if ("7".equals(bigClass)) {
			intent.setClass(context, PartTimeActivity.class);
		} else if ("8".equals(bigClass)) {
			intent.setClass(context, LivingActivity.class);
		}
		context.startActivity(intent);
	}

}
